package com.blb.zycommunity.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.blb.zycommunity.entity.SysUser;
import com.blb.zycommunity.entity.ZyOwner;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 业主  Mapper 接口
 * </p>
 *
 * @author chenheng
 * @since 2023-11-20
 */
public interface ZyOwnerMapper extends BaseMapper<ZyOwner> {

    IPage<ZyOwner> selectOwnerPage(IPage<ZyOwner> page,String communityId, String ownerNickname, String ownerRealName, String ownerIdCard, String ownerPhoneNumber);


    List<ZyOwner> selectAuditRecords(String ownerRealName);

    ZyOwner selectByOwnerNickname(String ownerNickname);

    /**
     * 根据用户名查询房间
     * @param ownerNickname
     * @return
     */
    List<ZyOwner> selectRoomByOwnerNickname (String ownerNickname);

    List<ZyOwner> selectCommunityIdByNickname (String ownerNickname);


    @Update("update zy_owner set owner_portrait = #{ownerPortrait} where owner_id = #{ownerId}")
    void updateOwnerPortrait(String ownerPortrait, String ownerId);
}
